package com.nelson.myapplication.converttype

import com.nelson.myapplication.abstractdemo.BaseDataProvider
import com.nelson.myapplication.abstractdemo.DataProviderImpl

class ConvertDemo {
    fun doNoting() {
        var provider: BaseDataProvider = DataProviderImpl()

        if (provider is DataProviderImpl) {

        }

        (provider as DataProviderImpl).doNothing();

        // 安全的强转，如果强转不成功就不执行
        (provider as? DataProviderImpl)?.doNothing();

    }
}